<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/tld/core.tld" prefix="c" %>
<%@ taglib uri="/WEB-INF/tld/fmt.tld" prefix="fmt" %>
<%@ taglib uri="/WEB-INF/tld/fn.tld" prefix="fn" %>

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'HotelList.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
  <div class="model_product_list">
				<c:choose>
					<c:when test="${!empty result && result.number>0}">
						<c:forEach var="hotel" items="${hotelList}" varStatus="vHotel">
							<div class="model_product_name">
								<h4><span><a href="#h${vHotel.index}" onclick="return bookingHotel('${hotel.hotelCode}','${hotel.vendorCode}');">${hotel.hotelName}</a>
										<strong><c:choose>
												<c:when test="${hotel.rank=='1' || hotel.rank=='1A'|| hotel.rank=='1S'}">★</c:when>
												<c:when test="${hotel.rank=='2' || hotel.rank=='2A'|| hotel.rank=='2S'}">★★</c:when>
												<c:when test="${hotel.rank=='3' || hotel.rank=='3A'|| hotel.rank=='3S'}">★★★</c:when>
												<c:when test="${hotel.rank=='4' || hotel.rank=='4A'|| hotel.rank=='4S'}">★★★★</c:when>
												<c:when test="${hotel.rank=='5' || hotel.rank=='5A'|| hotel.rank=='5S'}">★★★★★</c:when>
											</c:choose>
										</strong>
									 </span>
									 <em>最低价：<fmt:parseNumber value="${hotel.minRate}" integerOnly="true"/>元</em>
								</h4>
								<div class="model_product_table" style="margin:0; padding:0;">
									<p class="model_address"> 地址：${hotel.address} </p>	
									<dl class="model_productlist">										
										<c:set var="strImage" value="${hotel.hotelCode}"/>
										<dt><a href="javascript:void(0);" onclick="return bookingHotel('${hotel.hotelCode}','${hotel.vendorCode}');"><img src="<c:choose><c:when test='${empty hotel.hotelImage}'>/images/hotelpic0102.jpg</c:when><c:otherwise>http://media.sohoto.com/market/images/hotelimages${hotel.hotelImage}</c:otherwise></c:choose>" alt="${hotel.hotelName} 外景" border="0" with="150" height="130" onerror="this.src='/images2/link_wu2.gif'" /></a></dt>
										<dd><p>${hotel.basicInfo}</p></dd>
									</dl>	
									<div class="clear"></div>
									<table width="100%" border="0" cellspacing="1" cellpadding="0" class="model_product_tabcontainer1" id="tab_${hotel.hotelCode}">
										  <tr>
											<th width="28%" class="model_house">房型</th>
											<th width="14%">门市价</th>
											<th width="22%">时段</th>
											<th width="10%">优惠价</th>
											<th width="7%">佣金</th>
											<th width="8%">早餐</th>
											<th width="11%">预订</th>
										  </tr>
										  <c:forEach var="room" items="${hotel.roomTypeList}" varStatus="vs">
											  <tr <c:if test="${vs.index>=3}">style="display:none;" room="true"</c:if>>
												<td class="model_house">${room.roomTypeName}</td>
												<td class="red">
													<c:choose>
														<c:when test="${room.displayRate>0.0}">
															<fmt:parseNumber value="${room.displayRate}" integerOnly="true"/>元
														</c:when>
														<c:otherwise>待定</c:otherwise>
													</c:choose>
												</td>
												<td>${room.startDate}-${room.endDate}</td>
												<td class="red">
													<fmt:parseNumber value="${room.saleRate}" integerOnly="true"/>
												</td>
												<td class="red">
												<c:choose>
													<c:when test="${room.commission.commissionType eq 'PCT'}">
														${room.commission.percent}__<fmt:parseNumber value="${room.saleRate*room.commission.percent}" integerOnly="true"/>
													</c:when>
													<c:when test="${room.commission.commissionType eq 'FIX'}">
														${room.commission.fix}__<fmt:parseNumber value="${room.commission.fix}" integerOnly="true"/>
													</c:when>
													<c:otherwise>0</c:otherwise>
												</c:choose>
												</td>
												<td>
													<c:choose>
														<c:when test="${room.mealPlan==1}">单早</c:when>
														<c:when test="${room.mealPlan==2}">双早</c:when>
														<c:otherwise>无</c:otherwise>
													</c:choose>
			                  					</td>
												<td>
													<c:choose>
														<c:when test="${room.availabilityStatus>=0 || room.availabilityStatus==-2}">
															<button type="button" class="model_Bookings" onclick="return bookingHotel('${hotel.hotelCode}','${hotel.vendorCode}','${room.roomTypeCode}');">预订</button>
														</c:when>
														<c:when test="${room.availabilityStatus==-3}">满房</c:when>
														<c:when test="${room.availabilityStatus==-4}">房紧</c:when>
														<c:otherwise>关闭</c:otherwise>
													</c:choose>
												</td>
											  </tr>
										  </c:forEach>
										  <c:if test="${fn:length(hotel.roomTypeList)>3}">
										   <tr>
												<td colspan="5">&nbsp;</td>
												<td><a href="javascript:void(showMore('${hotel.hotelCode}','more_${hotel.hotelCode}'));" id="more_${hotel.hotelCode}">更多</a></td>
										   </tr>
										   </c:if>
								  	</table>
								  	<div class="clear"></div>
								</div>
							</div>
						</c:forEach>
					</c:when>
					<c:otherwise>
						<font color="red">提示:${result.description}</font>
					</c:otherwise>
				</c:choose>
				<!--酒店内容模块-->			
				</div>
  </body>
</html>
